<!--<?php
print <<<EOT
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link href="../css/admin.css" rel="stylesheet" type="text/css" />
<title>Promoter Order List</title>
</head>
<script language="javascript">
function checkAll()
{
	var ckbs=document.getElementsByName("ckb[]");
	for(i=0;i<ckbs.length;i++)
	{
		if(ckbs[i].checked==true)
		ckbs[i].checked=false;
		else
		ckbs[i].checked=true;
	}
}
</script>
<body>
<!--hidden filed-->
<form id="form1" name="form1" method="post" action="" onsubmit="return confirm('Are you sure?');">
<table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr> 
    <td>
	<br />
      	  <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td align="left"><table width="95%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td colspan="3" align="left" class="tbtitle">Promoter Order List </td>
            </tr>
            <tr>
              <td width="30%" height="20" align="left">PromoterID: {$pid}</td>
              <td colspan="2">Accumulated sales amount: DKK{$asa}</td>
            </tr>
            <tr>
              <td width="30%" height="20" align="left">Promoter Name: {$pname} </td>
              <td colspan="2">Accumulated commission: DKK{$ac}</td>
            </tr>
            <tr>
              <td height="20" align="left">&nbsp;</td>
              <td colspan="2">Commission outstanding: DKK{$co}</td>
            </tr>
            
            <tr>
              <td height="10" colspan="3" align="left">&nbsp;</td>
            </tr>
            <tr {$edit_style}>
              <td colspan="3" align="left">
                Pay commission to the selected order(s) width date
                <select name="pay_date" class="select">
				{$str_pay_date}
                </select> 
                           <input type="submit" name="Submit" value="Proceed" class="button" />              </td>
            </tr>
          </table></td>
        </tr>
        <tr>
          <td align="left"><span style="width:200px;">{$page_show}</span></td>
        </tr>
        <tr>
          
          <td align="left"><table width="100%" border="0" cellpadding="1" cellspacing="1" class="tb">
            <tr class="tbheader">
              <td colspan="6" align="center">Order</td>
              <td colspan="3" align="center">Commission</td>
              <td align="center">&nbsp;</td>
            </tr>
            <tr class="tbheader">
              <td><input name="ckall" type="checkbox" value="all" onclick="checkAll();"{$disable2}/></td>
              <td>Order ID </td>
              <td>Date</td>
              <td>Customer</td>
              <td>Amount</td>
              <td>Status</td>
              <td>Commission</td>
              <td>Commission Paid </td>
              <td>Commission Payment Date</td>
              <td>&nbsp;</td>
            </tr>
<!--
EOT;
for ($i=0;$i<count($out_ary);$i++){	
	if($out_ary[$i]["status"]==1)
	{
		$ckbname="ckb2[]";
		$disable=" disabled=\"disabled\"";
	}
	else
	{
		$ckbname="ckb[]";
		$disable="";
	}
print <<<EOT
-->
            <tr class="tbcontent1">
              <td align="center"><input name="{$ckbname}" type="checkbox" value="{$out_ary[$i][id]}" {$disable}{$disable2}/></td>
              <td align="center"><a href="c_order_enq.php?cid={$out_ary[$i][id]}" target="_self">{$out_ary[$i][id]}</a></td>
              <td align="center">{$out_ary[$i][date]}</td>
              <td align="center">{$out_ary[$i]['customer']}</td>
              <td align="center">{$out_ary[$i][cost]}</td>
              <td align="center">{$out_ary[$i]['deliver_status']}</td>
              <td align="center">{$out_ary[$i]['commission']}</td>
              <td align="center">{$out_ary[$i]['payment']}</td>
              <td align="center">{$out_ary[$i]['pay_date']}</td>
              <td align="center">{$out_ary[$i]['edit_link']}&nbsp;</td>
            </tr>
<!--

EOT;
}
if($sql_all_num==0)
	$row_zero="<tr class=\"tbcontent1\" height=\"23\"><td colspan=10 align=left>No records!</td></tr>";
print <<<EOT
--> 
			{$row_zero}
          </table>
		  {$page_show2}
<table width="100%" border="0" cellpadding="1" cellspacing="1" class="tb">
            
            <tr class="tbheader">
              <td colspan="7" align="left">Promoter orders for commission </td>
              </tr>
            <tr class="tbheader">
              <td>Order No.</td>
              <td>Order Date</td>
              <td>Order Amount</td>
              <td>Paid by commission</td>
              <td>Paid by cash</td>
              <td>Deliver Status</td>
              <td>&nbsp;</td>
            </tr>
<!--
EOT;
for ($i=0;$i<count($out_ary_p);$i++){	
print <<<EOT
-->
            <tr class="tbcontent1">
              <td align="center">{$out_ary_p[$i][id]}</td>
              <td align="center">{$out_ary_p[$i][date]}</td>
              <td align="center">{$out_ary_p[$i]['cost']}</td>
              <td align="center">{$out_ary_p[$i]['paidbycms']}</td>
              <td align="center">{$out_ary_p[$i]['pay_amount']}</td>
              <td align="center">{$out_ary_p[$i]['deliver_status']}</td>
              <td align="center">
			  <a href="c_order_p_edit.php?cid={$out_ary_p[$i]['id']}"><img src="../images/admin/bt_edit.gif" border="0" alt="Edit" /></a> 
			  <a href="c_order_p_enq.php?cid={$out_ary_p[$i]['id']}"><img src="../images/admin/bt_enquiry.gif" border="0" alt="Enquire" /> </a><a href="c_order_invoice_p.php?cid={$out_ary_p[$i]['id']}"><img src="../images/admin/mail_e.gif" border="0" Alt="Send Invoice No.(Eng)"></a> <a href="c_order_invoice_da_p.php?cid={$out_ary_p[$i]['id']}"><img src="../images/admin/mail_d.gif" border="0" Alt="Send Invoice No.(Dan)"></a>				</td>
            </tr>
<!--
EOT;
}
if($sql_all_num_p==0)
	$row_p_zero="<tr class=\"tbcontent1\" height=\"23\"><td colspan=7 align=left>No records!</td></tr>";
print <<<EOT

-->
		  {$row_p_zero}	
          </table>
	  
		  <a href="c_promoter.php" ><img src="../images/admin/bt_continue.gif" border="0" /></a></td>
  </tr>
</table></form>
</body>
</html>
<!--

EOT;

?>-->